﻿using System;
using System.Collections.Generic;
using System.Web;
using AMS.DataAccess.Sys.BO;

/// <summary>
/// Summary description for EnumConverter
/// </summary>
public static class EnumConverter
{
    private static volatile object syncObj = new object();
    private static Dictionary<SexEnum, string> SexMapping;

    public static string SexToString(SexEnum sex)
    {
        if (SexMapping == null)
        {
            lock (syncObj)
            {
                if (SexMapping == null)
                {
                    SexMapping = new Dictionary<SexEnum, string>();
                    SexMapping.Add(SexEnum.UnSpecified, "未说明");
                    SexMapping.Add(SexEnum.Male, "男");
                    SexMapping.Add(SexEnum.Female, "女");
                }
            }
        }

        return SexMapping[sex];
    }
}
